package models

import "gorm.io/gorm"

type User struct {
	gorm.Model
	Username string `gorm:"type:varchar(30)"`
	Password string `gorm:"type:varchar(32)"`
}

type Post struct {
	gorm.Model
	Title           string `gorm:"type:varchar(30)"`
	Content         string `gorm:"type:text"`
	Img             string `gorm:"type:varchar(255)"`
	CollectionCount int    `gorm:"type:int"`
	UserId          int    `gorm:"type:int"`
	User            User   `gorm:"foreignerKey:UserId"`
}

type Collection struct {
	gorm.Model
	UserId int  `gorm:"type:int"`
	User   User `gorm:"foreignerKey:UserId"`
	PostId int  `gorm:"type:int"`
	Post   Post `gorm:"foreignerKey:PostId"`
}
